{% extends 'AdminPanelDashboardBundle::layout.html.twig' %}


{% block stylesheets %}
  {{ parent() }}
{% endblock %}
{% block content %}

<div id="content">
  <ul class="breadcrumb">
    <li><a href="index.php" class="glyphicons home"><i></i> AdminPlus</a></li>
    <li class="divider"></li>
    <li>Site Pages</li>
  </ul>
  <div class="separator"></div>

  <div class="heading-buttons">
    <h3 class="glyphicons sort"><i></i> Мэдээ, мэдээлэл</h3>
    <div class="buttons pull-right">
      <a href="{{ path('news_new') }}" class="btn btn-primary btn-icon glyphicons circle_plus"><i></i> Шинэ мэдээ</a>      
    </div>
  </div>
  <div class="separator"></div>

  <div class="innerLR">
    <table class="table table-bordered table-condensed table-striped table-vertical-center checkboxs js-table-sortable">
      <thead>
        <tr>
          <th style="width: 1%;" class="uniformjs"></th>          
          <th style="vertical-align: middle">Гарчиг</th>
          <th style="vertical-align: middle">Мэдээний эх</th>          
          <th style="vertical-align: middle">Зураг</th>          
          <th style="vertical-align: middle; width: 1%" class="center">Төлөв</th>          
          <th style="vertical-align: middle;">Үүсгэсэн хэрэглэгч</th>          
          <th style="vertical-align: middle;">Шинэчилсэн огноо</th>
          <th class="center" style="vertical-align: middle;">Үйлдэл</th>
        </tr>
      </thead>
      <tbody>        
        {% for entity in entities %}
          <tr class="selectable">
            <td class="center uniformjs"><input type="checkbox" /></td>          
            <td><strong>{{ entity.news_title }}</strong></td>
            <td>{{ entity.news_body }}</td>
            <td style="width: 80px;">{% if entity.img_thumb is not null %}<img src="/{{ entity.img_thumb }}" height="75" width="75"/>{% endif %}</td>          
            <td class="center" style="width: 30px;">{% if entity.is_active == 1%}<button class="btn btn-block btn-success" style="font-size: 9px;width: 70px;">Идэвхитэй</button>{% else %}<button class="btn btn-block btn-warning" style="font-size: 9px;width: 70px;">Идэвхигүй</button>{% endif %}</td>          
            <td class="center" style="width: 30px;">{{ entity.created_user_id }}</td>                    
            <td class="center" style="width: 80px;">{% if entity.updated_at %}{{ entity.updated_at|date('Y-m-d H:i:s') }}{% endif %}</td>          
            <td style="width: 80px;">
              <a href="{{ path('news_edit', { 'id': entity.id }) }}" class="btn-action glyphicons pencil btn-success"><i></i></a>            
            </td>
          </tr>
        {% endfor %}

        </tbody>
      </table>

      <div class="separator top form-inline small">
        <div class="pull-left checkboxs_actions hide">
          <label class="strong">With selected:</label>
          <select class="selectpicker" data-style="btn-default btn-small">
            <option>Action</option>
            <option>Action</option>
            <option>Action</option>
          </select>
        </div>
        <div class="pagination pull-right" style="margin: 0;">
          <ul>
            <li class="disabled"><a href="#">&laquo;</a></li>
            <li class="active"><a href="#">1</a></li>
            <li><a href="#">2</a></li>
            <li><a href="#">3</a></li>
            <li><a href="#">&raquo;</a></li>
          </ul>
        </div>
        <div class="clearfix"></div>
      </div>
    </div>
    <br/>		
    <!-- End Content -->
  </div>

{% endblock %}
